package com.itheima;

import com.itheima.domain.User;
import com.itheima.service.UserService;

public class App {
    public static void main(String[] args) throws Exception{
        //创建spring容器对象
        SpringApplicationContext sac = new SpringApplicationContext("beans.xml");
        //获取容器中的对象
        UserService userService = (UserService) sac.getBean("userService");
        //使用对象中的方法
        User user = userService.findUser();
        System.out.println(user.toString());
    }
}
